package com.todo.biz.infrastructure.repository;

import com.todo.biz.infrastructure.entity.condition.AssociateCondition;
import com.todo.biz.infrastructure.entity.po.BizAssociatePO;
import com.todo.common.common.entity.response.page.PageResult;
import com.todo.common.common.enums.BusinessSceneEnum;

import java.util.List;

/**
 * (BizAssociate)表服务实现类
 *
 * @author zhangwenxiang
 * @since 2024-03-04 21:10:01
 */


public interface BizAssociateRepository {
    /**
     * 根据主键id查询关联信息
     *
     * @param id
     * @return
     */
    BizAssociatePO queryBizAssociatePOById(Long id);

    /**
     * 新增关联信息
     *
     * @param bizAssociatePO
     * @return
     */
    Boolean insertBizAssociatePO(BizAssociatePO bizAssociatePO);

    /**
     * 根据主键更新关联信息
     *
     * @param bizAssociatePO
     * @return
     */
    Boolean updateBizAssociatePOById(BizAssociatePO bizAssociatePO);

    /**
     * 根据主键id删除关联信息
     *
     * @param id
     * @return
     */
    Boolean removeBizAssociatePOById(Long id);

    /**
     * 根据条件查询关联信息
     *
     * @param associateCondition
     * @return
     */
    PageResult<BizAssociatePO> queryBizAssociateByCondition(AssociateCondition associateCondition);

    /**
     * 根据条件查询数量
     *
     * @param associateCondition
     * @return
     */
    Long queryCountByCondition(AssociateCondition associateCondition);

    /**
     * 根据用户下业务id和场景查询业务关联
     *
     * @param userId
     * @param bizId
     * @param scene
     * @return
     */
    List<BizAssociatePO> queryBizAssociateByBizIdAndScene(Long userId, Long bizId, BusinessSceneEnum scene);
}
